From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:24 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 11:13:25 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0001.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:13:57 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 13 15:21:18 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:21:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0002.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:20 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 15:21:20 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:20 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:20 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 13 15:21:20 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 15:21:20 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 13 16:00:51 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 16:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0003.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 16:00:53 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 20:01:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 13 20:01:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0004.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 13 20:01:49 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:25 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0005.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 08:02:26 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0006.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 12:00:51 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 14 16:00:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 16:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 16:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 16:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0007.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:49 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 14 16:00:49 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 16:00:49 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0008.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 14 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 14 20:00:48 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 14 20:00:48 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 15 08:02:13 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0009.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 08:02:14 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0010.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 12:00:56 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0011.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 16:00:48 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0012.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 15 20:00:48 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 16 08:02:35 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:36 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:37 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 08:02:37 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:37 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 08:02:37 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:37 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 08:02:37 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0013.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 08:02:38 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 16 12:00:51 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 12:00:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 12:00:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 12:00:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0014.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 12:00:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 16 16:00:51 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0015.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 16:00:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0016.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 16 20:00:48 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:38 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:39 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 08:02:40 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0017.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 08:02:41 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 17 12:01:07 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 12:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 12:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 12:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0018.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 17 12:01:08 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 12:01:09 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 17 16:00:53 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 16:00:53 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0019.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:55 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 17 16:00:55 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 16:00:55 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 20:00:55 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0020.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 17 20:00:56 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 18 08:04:22 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:23 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0021.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 08:04:24 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0022.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 12:01:10 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:35 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 16:01:36 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0023.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 16:01:37 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 18 20:00:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0024.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 18 20:01:00 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:46 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0025.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 08:04:47 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 19 12:01:03 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0026.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:04 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 12:01:05 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:05 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:05 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 19 12:01:05 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 12:01:05 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 19 16:03:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 16:03:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 16:03:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 19 16:03:14 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:15 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:17 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0027.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 16:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 19 16:03:19 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 16:03:19 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 19 20:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0028.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 19 20:00:53 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 20 08:07:28 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 08:07:28 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 08:07:28 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:29 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:30 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:31 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:31 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:31 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 20 08:07:31 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 08:07:31 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 08:07:31 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 08:07:32 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0029.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 08:07:33 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 12:02:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 12:02:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0030.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 12:02:15 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 16:00:56 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0031.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 16:00:57 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0032.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 20 20:00:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 08:04:02 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0033.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 08:04:03 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 12:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0034.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 12:01:06 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0035.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 16:00:56 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 21 20:00:53 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0036.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 21 20:00:54 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0037.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 08:02:54 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:55 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0038.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 12:00:56 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 16:01:28 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0039.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 16:01:29 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 22 20:01:21 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 20:01:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 20:01:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 22 20:01:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:22 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0040.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:24 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 22 20:01:24 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 22 20:01:24 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 08:02:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 23 08:02:49 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 08:02:50 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0041.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 08:02:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:00 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0042.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 12:01:01 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 23 16:01:55 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 16:01:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0043.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 16:01:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:01:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:00 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 23 16:02:00 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 16:02:00 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:55 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0044.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 23 20:00:56 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:20 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 08:03:21 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0045.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 08:03:22 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 24 12:03:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 12:03:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:17 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 12:03:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0046.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 12:03:19 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 24 16:01:30 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 16:01:30 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 16:01:30 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 16:01:30 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:31 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0047.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 16:01:33 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 20:02:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0048.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 24 20:02:01 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 25 08:02:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 08:02:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 08:02:11 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0049.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 08:02:12 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0050.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 12:01:10 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:04 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 16:01:05 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0051.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 16:01:08 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:00 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0052.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Jan 25 20:01:01 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 26 08:06:03 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 08:06:03 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 08:06:03 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 08:06:03 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:03 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:03 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 08:06:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 08:06:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0053.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 08:06:08 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:12 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0054.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 12:01:13 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 16:00:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0055.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 16:00:59 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Jan 26 20:00:50 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0056.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Jan 26 20:00:51 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 27 08:06:57 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 08:06:57 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 08:06:57 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 08:06:57 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:57 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:06:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:00 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 08:07:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 08:07:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 08:07:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 08:07:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 08:07:02 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 08:07:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0057.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 08:07:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:04 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:04 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 27 08:07:04 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 08:07:04 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0058.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 12:02:19 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:12 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0059.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 16:01:13 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:02 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0060.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Jan 27 20:01:03 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 08:05:54 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 08:05:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0061.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 08:05:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:57 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 28 08:05:57 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 08:05:57 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 12:02:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0062.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 12:02:01 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:00 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0063.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 16:01:01 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 20:01:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0064.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Jan 28 20:01:01 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 29 08:07:40 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0065.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 08:07:42 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 29 12:01:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0066.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 12:01:07 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 16:00:58 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0067.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 16:00:59 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Jan 29 20:01:01 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0068.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Jan 29 20:01:02 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 30 08:09:22 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 08:09:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 08:09:23 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 08:09:23 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 08:09:23 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 08:09:24 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:24 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 08:09:24 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 30 08:09:24 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 30 08:09:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 08:09:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 08:09:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 08:09:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 08:09:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:28 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:29 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 30 08:09:29 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:29 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:29 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:29 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 08:09:30 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:31 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 08:09:31 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:31 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 08:09:31 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 08:09:31 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 08:09:31 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0069.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 08:09:33 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:04 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 12:04:05 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0070.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 12:04:06 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:21 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:22 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0071.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 16:04:23 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Jan 30 20:02:20 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:21 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0072.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Jan 30 20:02:22 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:04 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 08:08:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 08:08:07 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0073.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 08:08:08 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 31 12:04:25 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 12:04:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:28 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0074.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 12:04:29 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 16:02:28 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 16:02:29 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0075.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 16:02:30 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Jan 31 20:01:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 20:01:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 20:01:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0076.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Jan 31 20:01:15 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 1 08:10:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 08:10:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 08:10:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 08:10:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:12 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 08:10:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:15 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:15 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 1 08:10:15 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0077.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 08:10:16 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 12:02:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0078.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 12:02:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 16:01:13 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0079.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 16:01:14 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0080.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 1 20:01:09 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 2 08:13:25 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 08:13:26 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 08:13:26 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 08:13:26 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:26 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 08:13:26 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 08:13:27 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:27 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 08:13:27 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 2 08:13:27 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 2 08:13:27 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 08:13:28 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 08:13:28 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:28 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:28 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:28 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:29 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 08:13:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:30 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 08:13:30 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 08:13:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 08:13:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:30 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 2 08:13:31 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:31 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:31 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:31 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:32 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:33 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:33 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 2 08:13:34 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 08:13:34 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 08:13:34 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:34 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:34 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 08:13:34 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:35 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 08:13:35 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:35 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 08:13:36 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:36 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 08:13:36 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 08:13:36 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 08:13:36 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 08:13:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0081.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 08:13:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:37 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:37 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 2 08:13:38 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 08:13:38 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 2 12:02:57 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 12:02:58 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 12:02:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0082.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 12:03:00 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 16:01:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0083.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 16:01:18 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 2 20:01:07 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0084.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 2 20:01:08 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 3 08:12:35 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 08:12:35 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 08:12:35 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 08:12:36 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 08:12:37 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:38 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:38 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:39 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 08:12:40 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 08:12:41 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:41 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 08:12:41 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 08:12:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 08:12:42 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 08:12:43 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0085.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:43 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 08:12:43 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:43 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:43 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 3 08:12:44 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 08:12:44 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 12:02:53 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0086.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 12:02:54 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:07 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0087.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 16:01:10 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 3 20:01:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 20:01:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 20:01:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0088.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 3 20:01:15 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 3 20:01:15 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 4 08:08:22 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 08:08:22 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 08:08:22 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 08:08:22 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 4 08:08:23 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:24 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:26 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:26 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:26 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:26 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 4 08:08:26 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 08:08:27 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 08:08:27 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:27 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:27 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 08:08:27 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0089.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:28 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:29 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 4 08:08:29 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 08:08:29 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 4 12:02:50 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:52 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0090.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 12:02:53 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:18 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0091.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 16:01:20 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:20 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:20 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 4 16:01:20 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 16:01:20 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 4 20:01:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 20:01:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 20:01:09 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 4 20:01:09 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:09 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:10 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0092.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 4 20:01:12 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 5 08:08:04 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 08:08:06 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0093.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 08:08:07 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:53 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0094.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 12:02:54 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:14 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0095.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 16:01:16 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 5 20:01:05 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0096.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 5 20:01:06 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 6 08:15:54 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 08:15:54 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 08:15:54 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 08:15:54 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:54 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:54 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 08:15:55 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 08:15:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:55 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 08:15:55 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 6 08:15:55 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 6 08:15:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 08:15:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 08:15:57 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 08:15:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 08:15:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 08:15:59 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 08:16:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0097.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 08:16:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 6 08:16:01 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 08:16:02 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 12:02:52 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 12:02:53 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0098.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 12:02:54 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:12 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 6 16:01:12 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 16:01:12 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 16:01:12 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:13 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:13 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 16:01:13 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:13 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 16:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0099.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 16:01:14 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 6 20:01:05 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0100.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 6 20:01:06 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 7 08:24:43 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 08:24:49 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 08:24:49 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 08:24:49 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:24:49 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:24:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 08:24:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 08:24:51 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:24:52 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 08:24:53 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 7 08:24:54 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 7 08:24:54 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 08:24:55 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 08:24:55 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:24:55 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:24:57 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:24:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:24:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:24:58 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 08:25:00 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:25:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:25:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 08:25:01 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 08:25:02 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 08:25:02 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 7 08:25:04 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:05 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:25:05 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:06 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:25:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:25:08 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 7 08:25:09 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 08:25:09 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 08:25:12 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:12 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:13 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 08:25:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 08:25:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 08:25:16 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 08:25:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 08:25:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 08:25:20 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 08:25:23 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0101.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 08:25:25 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:27 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 7 08:25:27 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 08:25:27 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:30 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:31 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 12:03:32 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0102.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 12:03:33 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0103.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 16:01:15 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0104.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 7 20:01:11 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 8 08:23:31 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 08:23:32 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 08:23:34 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 08:23:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:41 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 08:23:41 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 08:23:41 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:41 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 08:23:41 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 8 08:23:42 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 8 08:23:42 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 08:23:43 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:44 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:46 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:46 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:46 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 8 08:23:47 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 08:23:47 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 08:23:47 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:47 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 08:23:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 08:23:55 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 08:23:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 08:23:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 08:23:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 08:23:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 08:23:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0105.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 08:23:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:58 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 8 08:23:59 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 08:23:59 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 8 12:03:32 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:33 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0106.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 12:03:34 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:35 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:35 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 8 12:03:35 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 12:03:35 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 16:01:23 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:25 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0107.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 16:01:26 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:10 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0108.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 8 20:01:11 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 9 08:09:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 08:09:48 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 08:09:48 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 08:09:48 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:48 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 08:09:49 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 08:09:49 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:49 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:51 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 08:09:52 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 08:09:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 08:09:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:52 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 9 08:09:54 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:54 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:54 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 08:09:55 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 08:09:56 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 08:09:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0109.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 08:09:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:57 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:58 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 9 08:09:58 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 08:09:58 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0110.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 12:03:27 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 9 16:01:20 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:21 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0111.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 16:01:24 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 20:01:17 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0112.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 9 20:01:18 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 10 08:21:08 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 08:21:09 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 08:21:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 08:21:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 08:21:12 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 08:21:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 08:21:12 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 10 08:21:12 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 10 08:21:12 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 08:21:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 08:21:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:14 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 08:21:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 08:21:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 08:21:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 08:21:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:19 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 10 08:21:19 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:20 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:21 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:21 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:22 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:23 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 10 08:21:23 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 08:21:25 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 08:21:26 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:27 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:27 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 08:21:28 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:28 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 08:21:29 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:29 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 08:21:30 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:30 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 08:21:31 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 08:21:31 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 08:21:31 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 08:21:34 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0113.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:35 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 08:21:35 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:36 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:36 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 10 08:21:37 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 08:21:37 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 12:03:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 12:03:48 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0114.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 12:03:49 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 10 16:01:15 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 16:01:15 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 16:01:15 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 16:01:15 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:15 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0115.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 16:01:17 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Feb 10 20:01:18 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0116.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Feb 10 20:01:19 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:15 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 11 08:13:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 08:13:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 08:13:16 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:16 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 08:13:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 08:13:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0117.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 08:13:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:19 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:19 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 11 08:13:19 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 08:13:19 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 12:02:48 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 12:02:50 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 12:02:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0118.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 11 12:02:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 12:02:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 16:01:11 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:12 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0119.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 16:01:13 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:02 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0120.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sat Feb 11 20:01:03 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 12 08:09:46 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 08:09:46 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 08:09:46 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 08:09:46 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:46 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:47 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:48 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:49 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 12 08:09:49 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:49 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:49 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:49 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:50 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:50 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 12 08:09:50 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 08:09:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 08:09:51 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:51 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:51 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 08:09:51 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 08:09:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 08:09:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0121.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 08:09:53 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:54 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:54 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 12 08:09:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 08:09:54 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:56 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 12:02:57 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 12:02:58 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0122.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 12:02:59 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 16:01:16 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0123.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 16:01:17 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:08 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0124.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Sun Feb 12 20:01:09 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 13 08:17:39 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 08:17:40 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 08:17:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 08:17:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:41 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:41 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 08:17:41 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 08:17:41 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:41 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:42 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:43 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:43 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 08:17:43 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:43 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 08:17:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:46 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:46 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:46 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 13 08:17:47 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 08:17:47 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 08:17:48 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:48 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:48 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 08:17:48 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:48 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 08:17:49 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:49 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 08:17:49 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:49 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 08:17:49 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 08:17:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 08:17:50 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 08:17:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0125.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 08:17:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:51 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 13 08:17:52 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 08:17:52 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 13 12:03:16 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 12:03:17 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0126.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 12:03:18 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0127.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 16:01:33 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Mon Feb 13 20:01:14 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 20:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 20:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Mon Feb 13 20:01:14 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:14 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:15 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0128.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Mon Feb 13 20:01:16 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 14 08:19:49 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 08:19:49 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 08:19:51 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 14 08:19:51 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 14 08:19:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 08:19:51 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 08:19:51 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:51 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:52 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:52 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:53 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 08:19:53 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 08:19:54 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 08:19:54 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 08:19:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:55 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:56 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 14 08:19:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:56 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:56 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:57 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:57 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:58 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 14 08:19:58 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 08:19:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 08:19:58 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:58 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:58 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 08:19:59 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:59 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 08:19:59 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:19:59 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 08:19:59 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:00 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 08:20:00 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 08:20:01 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 08:20:01 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 08:20:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0129.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:03 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 08:20:04 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:04 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:04 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 14 08:20:05 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 08:20:05 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 14 12:03:31 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 12:03:31 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 12:03:31 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 12:03:31 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:31 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:32 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0130.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 12:03:33 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:44 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0131.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 16:01:45 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:16 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0132.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Tue Feb 14 20:01:17 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 15 08:29:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 08:29:14 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 08:29:15 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 08:29:15 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 08:29:17 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 08:29:18 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:19 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 08:29:21 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 15 08:29:21 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 15 08:29:24 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 08:29:25 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 08:29:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:26 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:26 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:27 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:27 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:28 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 08:29:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:28 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:29 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 08:29:30 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 08:29:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 08:29:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:31 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:32 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 15 08:29:32 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:36 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:36 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:37 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:37 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:38 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:40 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 15 08:29:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 08:29:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 08:29:41 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:42 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:42 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 08:29:42 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:43 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 08:29:43 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:44 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 08:29:45 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:45 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 08:29:45 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 08:29:46 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 08:29:46 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 08:29:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0133.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 08:29:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:52 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 15 08:29:54 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 08:29:55 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 15 12:05:37 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:38 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:40 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 12:05:41 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0134.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 12:05:42 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:40 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0135.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:41 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 15 16:01:42 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 16:01:42 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:13 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0136.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 19:28:14 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:01 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 20:14:02 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Wed Feb 15 20:14:02 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Wed Feb 15 20:14:03 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Wed Feb 15 20:14:03 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 20:14:05 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Wed Feb 15 20:14:06 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:07 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:08 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Wed Feb 15 20:14:08 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:08 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Wed Feb 15 20:14:08 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:09 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 20:14:09 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:09 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Wed Feb 15 20:14:09 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 20:14:09 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 20:14:09 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 20:14:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0137.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Wed Feb 15 20:14:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:12 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:12 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Wed Feb 15 20:14:13 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Wed Feb 15 20:14:13 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Thu Feb 16 08:47:09 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 16 08:47:15 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 16 08:47:15 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Thu Feb 16 08:47:16 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:16 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 16 08:47:16 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 16 08:47:16 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:17 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 16 08:47:17 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Thu Feb 16 08:47:17 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Thu Feb 16 08:47:17 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Thu Feb 16 08:47:21 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 16 08:47:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:24 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:24 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:25 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:25 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 16 08:47:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:25 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 16 08:47:26 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 16 08:47:26 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Thu Feb 16 08:47:26 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:27 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Thu Feb 16 08:47:28 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:28 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:28 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:29 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:30 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:31 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:31 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Thu Feb 16 08:47:31 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Thu Feb 16 08:47:31 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Thu Feb 16 08:47:32 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:32 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:33 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Thu Feb 16 08:47:33 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:33 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Thu Feb 16 08:47:35 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:36 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 16 08:47:36 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:36 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Thu Feb 16 08:47:36 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 16 08:47:36 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 16 08:47:37 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 16 08:47:44 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0138.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:44 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Thu Feb 16 08:47:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:45 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:46 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Thu Feb 16 08:47:46 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Thu Feb 16 08:47:46 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From harrelson at gmail.com Fri Oct 1 14:19:14 2004 From: harrelson at gmail.com (Culley Harrelson) Date: Fri Mar 31 16:33:49 2006 Subject: [egenix-users] OS X 10.3.5: *** You don't have the (right) mxDateTime binaries installed ! SOLVED Message-ID: <529825a3041001131911a74157@mail.gmail.com> Well kind of solved. I got it working through fink. culley From ielbert at genuone.com Fri Oct 8 16:51:45 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Mar 31 16:33:49 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance Message-ID: Hello, Our Zope installation procedure requires that we install Zope into a standard location and than install ours and third-party products and libs into another directory. We have no problems doing that with Oracle and other ODBC adapters but with mxODBC we are getting the following error: 2004-10-08T15:30:42 PANIC(300) z2 Startup exception Traceback (innermost last): File z2.py, line 2, in ? File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in startup (Object: startup) File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in startup File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in import_products File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in import_product File Products\mxODBCZopeDA\__init__.py, line 6, in ? File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? (Object: DatabaseConnectionPool) File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in __init__ IOError: [Errno 2] No such file or directory: 'C:\\Program Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' If I create directory Products/mxODBCZopeDA inside the standard Zope installation and put the pdf files there mxODBC works just fine except for the warning: """ After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. """ Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32 Please advise. Thanks, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Sat Oct 9 00:16:46 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Mar 31 16:33:49 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009031646.UATM2188.mta11.adelphia.net@mail.adelphia.net> I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From keithmoore1 at adelphia.net Sat Oct 9 00:20:09 2004 From: keithmoore1 at adelphia.net (keithmoore1@adelphia.net) Date: Fri Mar 31 16:33:49 2006 Subject: [egenix-users] mxDateTime Message-ID: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Help! I am new to Python... I am attempting to call a Python routine from C++. I tested the routine with the Python interpreter. I get no errors. But when I try to access it from C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't have the (right) mxDateTime binaries installed!" I've downloaded the latest version. I ran the .exe provided to install the files. Do I need to manually compile the files? If so, how? I didn't see setup.py in the installed directory. I've been struggling with this problem for the last 3 days. What am I doing wrong? Snippet::::::::::::::::::::::::::::::::::::::::::: someClass::someMethod() { PyObject *pstr, *pmod; printf("embed-object\n"); Py_Initialize(); // get usermod.message pmod = PyImport_ImportModule("OMS_Query"); ... } Thanks, Keith From mal at egenix.com Sat Oct 9 14:39:54 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:49 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> References: <20041009032009.VSIO2497.mta9.adelphia.net@mail.adelphia.net> Message-ID: <4167CE0A.7030907@egenix.com> keithmoore1@adelphia.net wrote: > Help! I am new to Python... > > I am attempting to call a Python routine from C++. I tested the routine with > the Python interpreter. I get no errors. But when I try to access it from > C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you don't > have the (right) mxDateTime binaries installed!" This messages indicates that Python cannot find the mxDateTime.pyd file that is needed by the mxDateTime package. Please make sure that you have installed the correct version of mxDateTime for the Python version you are using. It is also possible that your embedded Python version does not have the paths correctly setup: the egenix-mx-base installer will install the packages to the site-packages directory of your standard Python installation; the embedded interpreter will like look in different places for the modules. > I've downloaded the latest > version. I ran the .exe provided to install the files. Do I need to manually > compile the files? If so, how? I didn't see setup.py in the installed > directory. > > I've been struggling with this problem for the last 3 days. What am I doing > wrong? > > > Snippet::::::::::::::::::::::::::::::::::::::::::: > someClass::someMethod() > { > PyObject *pstr, *pmod; > printf("embed-object\n"); > Py_Initialize(); > > // get usermod.message > pmod = PyImport_ImportModule("OMS_Query"); > ... > } > > > Thanks, > > Keith > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 09 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From mal at egenix.com Mon Oct 11 17:33:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Installing mxODBC outside Zope instance In-Reply-To: References: Message-ID: <416A999C.4080508@egenix.com> Igor Elbert wrote: > Hello, > > Our Zope installation procedure requires that we install Zope into a > standard location and than install ours and third-party products and libs > into another directory. We have no problems doing that with Oracle and other > ODBC adapters but with mxODBC we are getting the following error: This is a known problem in mxODBC Zope DA 1.0.8 which will be fixed in the next patch level release. Until then, the work-around you used will work just fine. The problem is that the paths for the PDF documentation are hard-coded into the Zope DA product. As a result, installing the Zope DA to an instance directory causes the traceback you are seeing. > 2004-10-08T15:30:42 PANIC(300) z2 Startup exception > Traceback (innermost last): > File z2.py, line 2, in ? > File C:\Program Files\Zope/lib/python\Zope\__init__.py, line 38, in > startup > (Object: startup) > File C:\Program Files\Zope/lib/python\Zope\App\startup.py, line 38, in > startup > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 485, in > import_products > File C:\Program Files\Zope/lib/python\OFS\Application.py, line 502, in > import_product > File Products\mxODBCZopeDA\__init__.py, line 6, in ? > File Products\mxODBCZopeDA\ZopeDA.py, line 9, in ? > (Object: DatabaseConnectionPool) > File C:\Program Files\Zope/lib/python\App\ImageFile.py, line 30, in > __init__ > IOError: [Errno 2] No such file or directory: 'C:\\Program > Files\\Zope\\lib\\python\\Products/mxODBCZopeDA/mxODBC.pdf' > > If I create directory Products/mxODBCZopeDA inside the standard Zope > installation and put the pdf files there mxODBC works just fine except for > the warning: > """ > After loading Product 'mxODBCZopeDA' from 'C:\\tracker\\Zope\\Products', > I skipped the one in 'C:\\Program Files\\Zope/lib/python\\Products'. > """ > > Windows XP Pro, Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32 > > Please advise. > > Thanks, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 11 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From support at egenix.com Mon Oct 11 17:40:59 2004 From: support at egenix.com (Charlie Clark) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Fwd: [egenix-info] Problems with mxODBC please reply. Message-ID: <20041011164059.6572.13@Zeta.nameserver> Dear Shazad, sorry to hear you are having problems but they don't seem to be related to mxODBC specifically which is extensively documented. Are you using IDLE? We have a free mailing list for mxODBC users but you can also try the main Python mailing list. Good luck! Charlie Clark On [egenix-info] Problems with mxODBC please reply. at 16:22:41 [+0200], Khawaja-Shahzad Butt wrote: > Hello, > > I am a student at iowa state university. i am using mx.ODBC for > purpose of interfacing python with MSSQL server. There is no manual > or information on how to use SQL queries with mxODBC. > I have installed both base and commerical package. In order to get > support or your help do i have to purchase a license since i am student > and am just experiementing. > > I have spent countless hours on the erros and still finding a way to > eliminate all exceptions ( like ASCII decoding error, unicode error > Ordinal not in range (128)) .. etc. > > The following python code has SQL query which is giving me problem. > def > dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feedde > scription,item_dmodified): > > db = mx.ODBC.Windows.DriverConnect('DSN=**;UID=**;PWD=***') > c = db.cursor() > > #c.execute('insert into rss_feed > (feed_title,feed_url,feed_description,feed_rss_version) > values('%s','%s');') > #c.execute("insert into rss_feed(feed_title,feed_url) > values('%s','%s')" % (title,feed_url)) > > dq= "delete from rss_feed_items" > c.execute(dq) > > ## print " q is", fid_q > ## int(feed_id) # convert string to int // type(object) to > check object type > # to check an object/string is unicode type isinstance(str, unicode) > > q = "insert into > rss_feed_items(item_date,item_title,item_author,item_permalink,item_descript > ion)\ > values('%s','%s','%s','%s','%s')" % > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > > ## q = "insert into rss_feed_items" > > #c.execute ("""BEGIN""") > #q ="""insert into rss_feed(feed_title,feed_url) > values("%s","%s")""" % (title,feed_url) > #q = "insert into rss_feed(feed_url) values('%s')" % (feed_url) > #q1="""insert into rss_feed(feed_description) values("%s")""" % (summary) > #q2= "insert into provider(provider_name) values('%s')" % (auth) > q=q.encode("utf-8"); > ## q2=q2.encode("utf-8"); > #q1=q1.encode("utf-8"); > ## > c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_ > item_feeddescription)) > #c.execute("insert into rss_feed_items values(?,?,?,?,?)", > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription)) > c.execute(q) > #c.execute(q2) > > ## c.execute(q, > item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddesc > ription) > ## c.execute(q, > (item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddes > cription) > ) > > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > ## > values(%s,%s,%s,%s,%s)",(item_dmodified,feed_item_title,item_author,feed_ite > m_link,feed_item_feeddescription) > ) > > #c.execute(q1) > > db.commit() > > fid_q="select feed_id from rss_feed " > fid_q=fid_q.encode("utf-8"); > c.execute(fid_q) > row=c.fetchall() > c.tables(None,None,None,None) > > print "Hello=",row > print "length of tuple=",len(row) > > ## q3 = "insert into rss_feed_items(feed_id) values(%s')" % (fid_q) > > ## c.execute(q3) > db.commit() > #print q > > c.close() > db.close() > > Please tell is there another way of using SQL with mxODBC for insert, > delete, > update and select. > > Also should i use mxZope adaptor or not if i want to read and write > simutaneously > to the SQL server. > > Please reply . I hope you will help a student. > Regards > Shahzad -- 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 keithmoore1 at adelphia.net Thu Oct 14 08:24:22 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: <416E443C.30008@egenix.com> Message-ID: Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ debug to develop my code. As a result, its looking for mxDateTime_d.pyd and mxDateTime_d.dll. I need to use my debug project for development, but obviously, I don't need to debug the mx stuff. How do I get around this? -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, October 14, 2004 5:18 AM To: Keith Moore Subject: Re: [egenix-users] mxDateTime Keith Moore wrote: > Yes, I intend to embed egenix-mx-commercial > into my application. Once I get it working I intend to get the proper lisc. > I'd hate to buy it and be unable to use it as intended. Ok, understood. > I will submit my questions to the lists you suggested. Something you might want to try is to run the interpreter in verbose mode (python -vv). In an embedded app, this can be done by assigning 2 to the global var Py_VerboseFlag. Python will then print out where it looks for the .pyd files. > Thanks Again, > > Keith > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 4:47 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Sorry to bother you :( > > > Sorry, but I can't help you debug your problem. eGenix is > in the consulting business and so we can only give hints to > possible solutions on a non-contract basis. > > We do offer support for our products on a support ticket basis. > Please see our web-site for details. > > For free support you can try the egenix-users mailing list > or comp.lang.python. > > >>But I still can't figure it out. I'm running on Windows XP. >>I unintalled/reinstalled Python 2.3.4 >>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. > > > Are you saying that you want to embed egenix-mx-commercial > into your application ? I'm afraid that this is not allowed > without a proper developer license for mxODBC. > > >>I am able to use mxDateTime from the interpreter with no problems. But > > when > >>I try importing the same script into C++, I keep getting the mxDateTime >>error message. I even used sys.path at the top of my script to include > > the > >>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >> >>What is the difference between the interpreter and embedded python, that >>would mainifest this problem? What am I missing??? >> >>Thankyou, for your help, I do appreciate your time... >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Monday, October 11, 2004 5:04 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>I will try uninstalling Python then reinstall. How do I verify and/or >>>change the paths for the embedded interpreter? >> >> >>Try sys.path. >> >> >> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Saturday, October 09, 2004 7:40 AM >>>To: keithmoore1@adelphia.net >>>Cc: egenix-users@egenix.com >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>keithmoore1@adelphia.net wrote: >>> >>> >>> >>>>Help! I am new to Python... >>>> >>>>I am attempting to call a Python routine from C++. I tested the routine >>> >>>with >>> >>> >>> >>>>the Python interpreter. I get no errors. But when I try to access it >>> >>>from >>> >>> >>> >>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** you >>> >>>don't >>> >>> >>> >>>>have the (right) mxDateTime binaries installed!" >>> >>> >>>This messages indicates that Python cannot find the mxDateTime.pyd >>>file that is needed by the mxDateTime package. >>> >>>Please make sure that you have installed the correct version of >>>mxDateTime for the Python version you are using. >>> >>>It is also possible that your embedded Python version does not >>>have the paths correctly setup: the egenix-mx-base installer will >>>install the packages to the site-packages directory of your >>>standard Python installation; the embedded interpreter will >>>like look in different places for the modules. >>> >>> >>> >>> >>>>I've downloaded the latest >>>>version. I ran the .exe provided to install the files. Do I need to >>> >>>manually >>> >>> >>> >>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>directory. >>>> >>>>I've been struggling with this problem for the last 3 days. What am I >>> >>>doing >>> >>> >>> >>>>wrong? >>>> >>>> >>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>someClass::someMethod() >>>>{ >>>> PyObject *pstr, *pmod; >>>> printf("embed-object\n"); >>>> Py_Initialize(); >>>> >>>> // get usermod.message >>>> pmod = PyImport_ImportModule("OMS_Query"); >>>> ... >>>>} >>>> >>>> >>>>Thanks, >>>> >>>>Keith >>>> >>>> >>>> >>>>_______________________________________________________________________ >>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>> >>> >>>-- >>>Marc-Andre Lemburg >>>eGenix.com >>> >>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 11 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 14 15:22:18 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] mxDateTime In-Reply-To: References: Message-ID: <416E6F7A.90607@egenix.com> Keith Moore wrote: > Py_VerboseFlag=2: is pointing me to my problem. (Newbie error)I'm using VC++ > debug to develop my code. As a result, its looking for mxDateTime_d.pyd and > mxDateTime_d.dll. I need to use my debug project for development, but > obviously, I don't need to debug the mx stuff. How do I get around this? python setup.py build --debug install should get you debug builds of the needed egenix-mx-DLLs. > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, October 14, 2004 5:18 AM > To: Keith Moore > Subject: Re: [egenix-users] mxDateTime > > > Keith Moore wrote: > >>Yes, I intend to embed egenix-mx-commercial >>into my application. Once I get it working I intend to get the proper > > lisc. > >>I'd hate to buy it and be unable to use it as intended. > > > Ok, understood. > > >>I will submit my questions to the lists you suggested. > > > Something you might want to try is to run the interpreter > in verbose mode (python -vv). In an embedded app, this > can be done by assigning 2 to the global var Py_VerboseFlag. > > Python will then print out where it looks for the .pyd files. > > >>Thanks Again, >> >>Keith >> >>-----Original Message----- >>From: M.-A. Lemburg [mailto:mal@egenix.com] >>Sent: Thursday, October 14, 2004 4:47 AM >>To: Keith Moore >>Subject: Re: [egenix-users] mxDateTime >> >> >>Keith Moore wrote: >> >> >>>Sorry to bother you :( >> >> >>Sorry, but I can't help you debug your problem. eGenix is >>in the consulting business and so we can only give hints to >>possible solutions on a non-contract basis. >> >>We do offer support for our products on a support ticket basis. >>Please see our web-site for details. >> >>For free support you can try the egenix-users mailing list >>or comp.lang.python. >> >> >> >>>But I still can't figure it out. I'm running on Windows XP. >>>I unintalled/reinstalled Python 2.3.4 >>>I installed egenix-mx-base-2.0.5.win32-py2.3.exe, first >>>I installed egenix-mx-commercial-2.0.6.win32-py2.3.exe, second. >> >> >>Are you saying that you want to embed egenix-mx-commercial >>into your application ? I'm afraid that this is not allowed >>without a proper developer license for mxODBC. >> >> >> >>>I am able to use mxDateTime from the interpreter with no problems. But >> >>when >> >> >>>I try importing the same script into C++, I keep getting the mxDateTime >>>error message. I even used sys.path at the top of my script to include >> >>the >> >> >>>path to mxDateTime.pyd. I even put a copy in C:\Python23\DLL. >>> >>>What is the difference between the interpreter and embedded python, that >>>would mainifest this problem? What am I missing??? >>> >>>Thankyou, for your help, I do appreciate your time... >>> >>>-----Original Message----- >>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>Sent: Monday, October 11, 2004 5:04 AM >>>To: Keith Moore >>>Subject: Re: [egenix-users] mxDateTime >>> >>> >>>Keith Moore wrote: >>> >>> >>> >>>>I will try uninstalling Python then reinstall. How do I verify and/or >>>>change the paths for the embedded interpreter? >>> >>> >>>Try sys.path. >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: M.-A. Lemburg [mailto:mal@egenix.com] >>>>Sent: Saturday, October 09, 2004 7:40 AM >>>>To: keithmoore1@adelphia.net >>>>Cc: egenix-users@egenix.com >>>>Subject: Re: [egenix-users] mxDateTime >>>> >>>> >>>>keithmoore1@adelphia.net wrote: >>>> >>>> >>>> >>>> >>>>>Help! I am new to Python... >>>>> >>>>>I am attempting to call a Python routine from C++. I tested the routine >>>> >>>>with >>>> >>>> >>>> >>>> >>>>>the Python interpreter. I get no errors. But when I try to access it >>>> >>>>from >>>> >>>> >>>> >>>> >>>>>C++, using PyImport_ImportModule(...) (See snippet below), I get "*** > > you > >>>>don't >>>> >>>> >>>> >>>> >>>>>have the (right) mxDateTime binaries installed!" >>>> >>>> >>>>This messages indicates that Python cannot find the mxDateTime.pyd >>>>file that is needed by the mxDateTime package. >>>> >>>>Please make sure that you have installed the correct version of >>>>mxDateTime for the Python version you are using. >>>> >>>>It is also possible that your embedded Python version does not >>>>have the paths correctly setup: the egenix-mx-base installer will >>>>install the packages to the site-packages directory of your >>>>standard Python installation; the embedded interpreter will >>>>like look in different places for the modules. >>>> >>>> >>>> >>>> >>>> >>>>>I've downloaded the latest >>>>>version. I ran the .exe provided to install the files. Do I need to >>>> >>>>manually >>>> >>>> >>>> >>>> >>>>>compile the files? If so, how? I didn't see setup.py in the installed >>>>>directory. >>>>> >>>>>I've been struggling with this problem for the last 3 days. What am I >>>> >>>>doing >>>> >>>> >>>> >>>> >>>>>wrong? >>>>> >>>>> >>>>>Snippet::::::::::::::::::::::::::::::::::::::::::: >>>>>someClass::someMethod() >>>>>{ >>>>> PyObject *pstr, *pmod; >>>>> printf("embed-object\n"); >>>>> Py_Initialize(); >>>>> >>>>> // get usermod.message >>>>> pmod = PyImport_ImportModule("OMS_Query"); >>>>> ... >>>>>} >>>>> >>>>> >>>>>Thanks, >>>>> >>>>>Keith >>>>> >>>>> >>>>> >>>>>_______________________________________________________________________ >>>>>eGenix.com User Mailing List http://www.egenix.com/ >>>>>http://lists.egenix.com/mailman/listinfo/egenix-users >>>> >>>> >>>>-- >>>>Marc-Andre Lemburg >>>>eGenix.com >>>> >>>>Professional Python Services directly from the Source (#1, Oct 09 2004) >>>> >>>> >>>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>>mxODBC.Zope.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, Oct 11 2004) >>> >>>>>>Python/Zope Consulting and Support ... http://www.egenix.com/ >>>>>>mxODBC.Zope.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, Oct 14 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.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, Oct 14 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.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, Oct 14 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From keithmoore1 at adelphia.net Thu Oct 14 11:04:55 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] mxDateTime_d.pyd , mxDateTime_d.dll Message-ID: Hi All, I am attempting to build a debug version of the mxDateTime_d.pyd and mxDateTime_d.dll. C:\Python23\egenix-mx-base-2.0.5>python setup.py build --debug install This is my output: (What am I doing wrong?) running build running mx_autoconf C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'strptime' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(4) : error C2065: 'timegm' : undeclared identifier failure. removing: _configtest.c _configtest.obj C:\Program Files\Microsoft Visual Studio\VC98\BIN\cl.exe /c /nologo /Ox /MD /W3 /GX /DNDEBUG /O2 /Gf /GB /GD /Ob2 -D_GNU_SOURCE=1 -I C:\Python23\include -IC:\Python23\include /Tc_configtest.c /Fo_configtest.obj _configtest.c _configtest.c(5) : error C2133: 'mxarray' : unknown size failure. removing: _configtest.c _configtest.obj running build_ext building 'mx.DateTime.mxDateTime.mxDateTime' extension C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo /INCREMENTAL:no /pdb:None /DEBUG /LIBPATH:C:\Python23\libs / LIBPATH:C:\Python23\PCBuild /LIBPATH:C:\Python23\lib /EXPORT:initmxDateTime build\temp.win32-2.3\Debug\mx\DateTime\mxDateTime\mxDate Time\mx/DateTime/mxDateTime/mxDateTime.obj /OUT:build\lib.win32-2.3\mx\DateTime\mxDateTime\mxDateTime_d.pyd /IMPLIB:build\temp.win32 -2.3\Debug\mx\DateTime\mxDateTime\mxDateTime\mx/DateTime/mxDateTime\mxDateTi me_d.lib LINK : fatal error LNK1104: cannot open file "python23_d.lib" error: command '"C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe"' failed with exit status 1104 C:\Python23\egenix-mx-base-2.0.5> From joseph.kocherhans at hsc.utah.edu Thu Oct 14 15:09:59 2004 From: joseph.kocherhans at hsc.utah.edu (Joseph Kocherhans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] zope3 Message-ID: <0686FE86-1E1D-11D9-B731-000D936AC6CC@hsc.utah.edu> Hello, I've been using zope3 for a couple of months now and I've written a very naive mxodbcda which uses the mx-commercial package. It works for simple things, but I'm having a lot of issues with threading, pooling, etc. The hard stuff :) I know a port of the mxODBC Zope DA probably isn't something under active development yet, but I'm very anxious to get something better working. Is there anything is the works? Do you need beta testers? :) Thanks Joseph Kocherhans Intermountain Injury Control Research Center From kshahzadbutt at gmail.com Mon Oct 18 11:35:53 2004 From: kshahzadbutt at gmail.com (Khawaja-Shahzad Butt) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) Message-ID: Hello all, my code looks like this: db = mx.ODBC.Windows.DriverConnect('DSN=zoe;UID=test;PWD=temp') c = db.cursor() dq= "delete from rss_feed_items" c.execute(dq) feed_item_feeddescription_utf8=feed_item_feeddescription.encode('utf8'); feed_item_title=feed_item_title.encode('utf8'); feed_item_link=feed_item_link.encode('utf8'); item_author=item_author.encode('utf8'); item_dmodified=item_dmodified.encode('utf8'); q="""INSERT INTO rss_feed_items( item_date, item_title, item_author, item_permalink, item_description) VALUES( ?, ?, ?, ?, ?)""" . c.execute(q,(item_dmodified,feed_item_title,item_author,feed_item_link,feed_item_feeddescription_utf8),) db.commit() c.close() db.close() I get this error: Traceback (most recent call last): File "C:\Python23\Lib\site-packages\Pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript exec codeObject in __main__.__dict__ File "C:\feedparser-3.3\feedparser\test.py", line 573, in ? File "C:\feedparser-3.3\feedparser\test.py", line 41, in info_extract rss_20extraction(result,url) File "C:\feedparser-3.3\feedparser\test.py", line 312, in rss_20extraction dbinsertfeeditem(feed_item_title,feed_item_link,item_author,feed_item_feeddescription,item_dmodified) File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem ## c.execute("insert into rss_feed_items (item_date,item_title,item_author,item_permalink,item_description)\ DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) I am using connection to SQL servers as system DSN. python win and mxODBC. I am unable to figure what's the problem. Please reply Thank you From support at egenix.com Mon Oct 18 18:52:06 2004 From: support at egenix.com (Charlie Clark) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification', 4579) In-Reply-To: References: Message-ID: <20041018175206.47707.2@Zeta.1098088161.fake> On 2004-10-18 at 17:35:53 [+0200], Khawaja-Shahzad Butt wrote: > File "C:\feedparser-3.3\feedparser\test.py", line 432, in dbinsertfeeditem > ## c.execute("insert into rss_feed_items > (item_date,item_title,item_author,item_permalink,item_description)\ > DataError: ('22005', 0, '[Microsoft][ODBC SQL Server Driver]Invalid > character value for cast specification', 4579) > > I am using connection to SQL servers as system DSN. python win and mxODBC. > I am unable to figure what's the problem. > Please reply > Thank you Dear Khawaja, this is an MS-SQL driver error and is not related to mxODBC. Please check the MS-SQL documentation and support pages. Good luck! Charlie Clark From ielbert at genuone.com Tue Oct 19 13:41:52 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error Message-ID: We have a query with a 'Maximum rows to retrieve' parameter set to a huge number 1000000000 (we do not need a limit). The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. With ZOracleDA we do not have any problems. With mxODBCZopeDA we got MemoryError even if the query does not return any rows. It looks like mxODBCZopeDA tries preallocate memory without checking if it's needed. While we did not find it in the manual it seems like setting 'Maximum rows to retrieve' to 0 removes the limit but it makes the query incompatible with ZOracleDA which does not return any rows if the parameter set to 0. The traceback: Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.85.1117 mxODBC Zope DA 1.0.8 Error, exceptions.MemoryError Module ZPublisher.Publish, line 49, in publish Module ZPublisher.mapply, line 32, in mapply Module ZPublisher.Publish, line 38, in call_object Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 295, in manage_test Module Shared.DC.ZRDB.DA, line 374, in __call__ Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback Regards, Igor This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From martin.evans at easysoft.com Tue Oct 19 19:02:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them Message-ID: Hi, I have some python which uses mxODBC to insert into a database. The insert causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the diagnostic to the terminal. I don't want to see this. I am no Python expert by a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by setting an error handler but I don't know how to tie the error handler to my connection e.g. import mx.ODBC.unixODBC as mx db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') db.errorhandler = None # want to insert the name of my handler here # as per 2.7.1 example c = db.cursor() c.execute('use test') fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know the example above is not an insert but the "use test" to MS SQL Server causes an informational. I saw mxODBC can be compiled to stop the display of informationals but that is not an option for me. I am using mxODBC 2.0.1 if that makes a difference. Any ideas? Martin -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Tue Oct 19 22:00:12 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Large Number in ZSQL 'Maximum rows to retrieve' parameter causes Memory Error In-Reply-To: References: Message-ID: <4175643C.1010308@egenix.com> Igor Elbert wrote: > We have a query with a 'Maximum rows to retrieve' parameter set to a huge > number 1000000000 (we do not need a limit). > > The query is supposed to work with both ZOracleDA and mxODBCZopeDA adapters. > With ZOracleDA we do not have any problems. With mxODBCZopeDA we got > MemoryError even if the query does not return any rows. > It looks like mxODBCZopeDA tries preallocate memory without checking if it's > needed. That's true. mxODBC preallocates the number of rows you want to fetch in order to make fetching faster (you normally specify a value smaller than the expected result set size). > While we did not find it in the manual it seems like setting 'Maximum rows > to retrieve' to 0 removes the limit but it makes the query incompatible with > ZOracleDA which does not return any rows if the parameter set to 0. True again. You can also set it to None. The check done in mxODBC Zope DA is a simple truth test: if not max_rows: rowset = cursor.fetchall() else: rowset = cursor.fetchmany(max_rows) The problem is with max_rows is related to the Zope DA API design: The ZSQL interface forces usage of a max_rows parameter (which defaults to 1000 rows). The only way to correctly disable the max_rows limitation is by setting the parameter to 0. Perhaps we should provide a way to override the max_rows setting altogether on a per connection basis ?! > The traceback: > > Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.85.1117 > mxODBC Zope DA 1.0.8 > > Error, exceptions.MemoryError > > Module ZPublisher.Publish, line 49, in publish > Module ZPublisher.mapply, line 32, in mapply > Module ZPublisher.Publish, line 38, in call_object > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 295, in manage_test > Module Shared.DC.ZRDB.DA, line 374, in __call__ > Module Products.mxODBCZopeDA.ZopeDA, line 1323, in query > Module Products.mxODBCZopeDA.ZopeDA, line 1227, in run_cursor_callback > > Regards, > Igor > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 19 22:03:16 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <417564F4.60104@egenix.com> Martin J. Evans wrote: > Hi, > > I have some python which uses mxODBC to insert into a database. The insert > causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the > diagnostic to the terminal. I don't want to see this. I am no Python expert by > a long way. I read "2.7.1 Database Warnings" saying you can catch warnings by > setting an error handler but I don't know how to tie the error handler to my > connection e.g. > > import mx.ODBC.unixODBC as mx > db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') > db.errorhandler = None # want to insert the name of my handler here > # as per 2.7.1 example > c = db.cursor() > c.execute('use test') > > fails with "TypeError: attribute 'errorhandler' unknown or read-only". I know > the example above is not an insert but the "use test" to MS SQL Server > causes an informational. The .errorhandler feature is part of mxODBC 2.1 which is the basis for the mxODBC Zope DA. It is not available in the standalone version of mxODBC which is still at 2.0. > I saw mxODBC can be compiled to stop the display of informationals but > that is not an option for me. > > I am using mxODBC 2.0.1 if that makes a difference. > > Any ideas? I guess you will have to wait for mxODBC 2.1. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 19 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 10:01:14 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: <417564F4.60104@egenix.com> Message-ID: Forgive me for asking but do you know about how long I'll have to wait for mxODBC 2.1? If you can't answer that (which would not surprise me) do you have an idea of how complicated it would be to port errorhandler from mxODBC Zope DA to standalone mxODBC? Martin -- Martin J. Evans Easysoft Ltd, UK Development On 19-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Hi, >> >> I have some python which uses mxODBC to insert into a database. The insert >> causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >> diagnostic to the terminal. I don't want to see this. I am no Python expert >> by >> a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >> by >> setting an error handler but I don't know how to tie the error handler to my >> connection e.g. >> >> import mx.ODBC.unixODBC as mx >> db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >> db.errorhandler = None # want to insert the name of my handler here >> # as per 2.7.1 example >> c = db.cursor() >> c.execute('use test') >> >> fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >> know >> the example above is not an insert but the "use test" to MS SQL Server >> causes an informational. > > The .errorhandler feature is part of mxODBC 2.1 which is > the basis for the mxODBC Zope DA. It is not available in the > standalone version of mxODBC which is still at 2.0. > >> I saw mxODBC can be compiled to stop the display of informationals but >> that is not an option for me. >> >> I am using mxODBC 2.0.1 if that makes a difference. >> >> Any ideas? > > I guess you will have to wait for mxODBC 2.1. > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 19 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Wed Oct 20 11:23:33 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Catching informational messages in mxODBC and discarding them In-Reply-To: References: Message-ID: <41762085.2000306@egenix.com> Martin J. Evans wrote: > Forgive me for asking but do you know about how long I'll have to wait for > mxODBC 2.1? We are currently planning for doing a new release in November. > If you can't answer that (which would not surprise me) do you have an idea of > how complicated it would be to port errorhandler from mxODBC Zope DA to > standalone mxODBC? That would be major work since the error handling logic was mostly rewritten in order to make it more flexible w/r to dealing with ODBC driver specific errors and warnings (e.g. in some cases, you want to raise execptions for warnings, in other cases, you don't, or there is a way to deal with the problem in some other way). > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 19-Oct-2004 M.-A. Lemburg wrote: > >>Martin J. Evans wrote: >> >>>Hi, >>> >>>I have some python which uses mxODBC to insert into a database. The insert >>>causes an ODBC SQL_SUCCESS_WITH_INFO return in execute() and outputs the >>>diagnostic to the terminal. I don't want to see this. I am no Python expert >>>by >>>a long way. I read "2.7.1 Database Warnings" saying you can catch warnings >>>by >>>setting an error handler but I don't know how to tie the error handler to my >>>connection e.g. >>> >>>import mx.ODBC.unixODBC as mx >>>db = mx.DriverConnect('DSN=test;UID=user;PWD=password;') >>>db.errorhandler = None # want to insert the name of my handler here >>> # as per 2.7.1 example >>>c = db.cursor() >>>c.execute('use test') >>> >>>fails with "TypeError: attribute 'errorhandler' unknown or read-only". I >>>know >>>the example above is not an insert but the "use test" to MS SQL Server >>>causes an informational. >> >>The .errorhandler feature is part of mxODBC 2.1 which is >>the basis for the mxODBC Zope DA. It is not available in the >>standalone version of mxODBC which is still at 2.0. >> >> >>>I saw mxODBC can be compiled to stop the display of informationals but >>>that is not an option for me. >>> >>>I am using mxODBC 2.0.1 if that makes a difference. >>> >>>Any ideas? >> >>I guess you will have to wait for mxODBC 2.1. >> >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 19 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Wed Oct 20 15:43:25 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 Message-ID: <200410201443.26114.lrehe@awi-bremerhaven.de> Dear listmembers, I need to install the mxODBC package on a Sparc/Solaris 8 machine. I want to use the EasySoft ODBC-ODBC bridge from a python application and tried to install mxODBC. I followed the 'Manual Installation Procedure': 1. unpack 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft ODBC-ODBC Bridge) 4. make returns the following error: > gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 > @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > -c ././mxSQLCodes.c -o ./mxSQLCodes.o > gcc: cannot specify -o with -c or -S and multiple compilations > *** Error code 1 > make: Fatal error: Command failed for target `mxSQLCodes.o' I tried to follow the instructions that were given in reply to http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html (Problem building egenix-mx-commercial) but that didn't help. When I tried 'python setup.py install in the root-directory of the source-package, there were a lot of gcc errors: > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory > mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory > In file included from mx/ODBC/iODBC/mxODBC.c:33: > mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" > mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union > mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token I admit that this is my first experience with python and its modules and that I am not a C-programmer, so think in 'newbie'-terms. Thanks for your time, Lars -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From martin.evans at easysoft.com Wed Oct 20 14:48:35 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <200410201443.26114.lrehe@awi-bremerhaven.de> Message-ID: I got it working like this: http://www.easysoft.com/products/2002/mxodbc.phtml Any feedback on this document welcome. but see a comment below. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 20-Oct-2004 Lars Rehe wrote: > Dear listmembers, > > I need to install the mxODBC package on a Sparc/Solaris 8 machine. > > I want to use the EasySoft ODBC-ODBC bridge from a python application and > tried to install mxODBC. I followed the 'Manual Installation Procedure': > > 1. unpack > 2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot > 3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft > ODBC-ODBC Bridge) > 4. make returns the following error: >> gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> -I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >> @DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP I think this @DEFS@ is the problem and vaguely remember it. You need to get it out of the compile line. >> -c ././mxSQLCodes.c -o ./mxSQLCodes.o >> gcc: cannot specify -o with -c or -S and multiple compilations >> *** Error code 1 >> make: Fatal error: Command failed for target `mxSQLCodes.o' > > I tried to follow the instructions that were given in reply to > http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html > (Problem building egenix-mx-commercial) but that didn't help. When I tried > 'python setup.py install in the root-directory of the source-package, there > were a lot of gcc errors: >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >> mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >> In file included from mx/ODBC/iODBC/mxODBC.c:33: >> mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >> mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >> mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token > > > I admit that this is my first experience with python and its modules and that > I am not a C-programmer, so think in 'newbie'-terms. > > Thanks for your time, > Lars From mal at egenix.com Wed Oct 20 16:25:34 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <4176674E.8060807@egenix.com> Martin J. Evans wrote: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. Editing mxCOMMERCIAL.py is definitely the way to go. I didn't even know that the stone old Makefile.pre.in approach still works with more recent Python versions. BTW, what are the reasons for the "However, for recent versions of mxODBC (2+) we strongly recommend building mxODBC with unixODBC support." comment on that page ? While I agree that using an ODBC manager for better abstraction and easy of configuration, is there anything preventing the direct linking from working ? > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > On 20-Oct-2004 Lars Rehe wrote: > >>Dear listmembers, >> >>I need to install the mxODBC package on a Sparc/Solaris 8 machine. >> >>I want to use the EasySoft ODBC-ODBC bridge from a python application and >>tried to install mxODBC. I followed the 'Manual Installation Procedure': >> >>1. unpack >>2. in mx/ODBC/EasySoft 'make -f Makefile.pre.in boot >>3. edited 'Setup' and uncommented lines 417-420 (ODBC interface to EasySoft >>ODBC-ODBC Bridge) >>4. make returns the following error: >> >>>gcc -fPIC -DNDEBUG -g -O3 -Wall -Wstrict-prototypes >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>-I/usr/local/projects/e-net_apache_webserver/python-2.3.4/include/python2.3 >>>@DEFS@ -DMAL_DEBUG -DWANT_UNICODE_SUPPORT -DMISSING_SETUP > > > I think this @DEFS@ is the problem and vaguely remember it. > You need to get it out of the compile line. > > >>>-c ././mxSQLCodes.c -o ./mxSQLCodes.o >>>gcc: cannot specify -o with -c or -S and multiple compilations >>>*** Error code 1 >>>make: Fatal error: Command failed for target `mxSQLCodes.o' >> >>I tried to follow the instructions that were given in reply to >>http://www.egenix.com/mailman-archives/egenix-users/2004-April/000408.html >>(Problem building egenix-mx-commercial) but that didn't help. When I tried >>'python setup.py install in the root-directory of the source-package, there >>were a lot of gcc errors: >> >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:239:19: sql.h: No such file or directory >>>mx/ODBC/iODBC/mxODBC.h:240:22: sqlext.h: No such file or directory >>>In file included from mx/ODBC/iODBC/mxODBC.c:33: >>>mx/ODBC/iODBC/mxODBC.h:682: error: parse error before "SQLHDBC" >>>mx/ODBC/iODBC/mxODBC.h:682: warning: no semicolon at end of struct or union >>>mx/ODBC/iODBC/mxODBC.h:699: error: parse error before ':' token >> >> >> >>I admit that this is my first experience with python and its modules and that >>I am not a C-programmer, so think in 'newbie'-terms. >> >>Thanks for your time, >> Lars > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 20 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Wed Oct 20 16:25:15 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: <4176674E.8060807@egenix.com> Message-ID: On 20-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> I got it working like this: >> >> http://www.easysoft.com/products/2002/mxodbc.phtml >> >> Any feedback on this document welcome. > > Editing mxCOMMERCIAL.py is definitely the way to go. I didn't > even know that the stone old Makefile.pre.in approach still > works with more recent Python versions. > > BTW, what are the reasons for the "However, for recent versions of > mxODBC (2+) we strongly recommend building mxODBC with unixODBC > support." comment on that page ? > > While I agree that using an ODBC manager for better abstraction > and easy of configuration, is there anything preventing the > direct linking from working ? Off the top of my head the reasons for this statement were: 1. the link I posted is to our web site and that document was to help people using mxODBC with our drivers which are all distributed with unixODBC. Lars Rehe said he wanted to use OOB. 2. We (Easysoft or rather Easysoft employees and specifically Nick Gorham) wrote a large percentage of unixODBC so we are: a) more comfortable and knowledgable with unixODBC b) can fix issues in it very quickly c) we supply multiple ODBC drivers and this doesn't work without a driver manager or multiple copies of mxODBC. 3. Using an ODBC driver manager allows you to configure mxODBC once and add ODBC drivers later without changing/rebuilding/reconfiguring mxODBC. 4. unixODBC offers ODBC API level tracing making tracking down issues easier. 5. unixODBC can protect non-thread drivers from threaded apps. 6. unixODBC supports connection pooling speeding up repeated connections massively. 7. unixODBC comes with odbcinst program which can be used to easily add drivers and data sources at install time vastly reducing installation problems. 8. a driver manager can isolate a program from ODBC 2 and ODBC 3 differences. 9. unixODBC supports the ANSI and Wide SQLxxx functions and can support UNICODE apps using a ANSI ODBC driver and vice versa. 10. DSN-less and FILEDSN connections are only meaningful with a driver manager. 11. A driver manager allows you to separate your application from a specific driver. There is nothing "preventing the direct linking from working". In fact, as you are probably aware, the URL I mentioned used to (a long time ago) direct you to do this. IIRC, the "(2+)" comment originates from the fact that mxODBC 2 added support in the configure for driver managers (and specifically unixODBC) but you'd know that better than me. Basically the "strongly recommend" comes from the experience that getting applications/interfaces to build/configure with unixODBC then add ODBC drivers to unixODBC is easier and less error prone than directly linking with a driver plus allows you to use multiple ODBC drivers. Hope this answers your question. As I said before, all comments/suggestions on the above URL welcome. Martin -- Martin J. Evans Easysoft Ltd, UK Development From lrehe at awi-bremerhaven.de Wed Oct 20 17:46:07 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Installing mxODBC on Solaris 8 In-Reply-To: References: Message-ID: <200410201646.08222.lrehe@awi-bremerhaven.de> Brilliant! Your document was exactly what I needed. I followed the steps and managed to get the mxODBC.unixODBC driver working. Well... after I went through my usual hassle with wrong or missing library-paths under Solaris. Thank you very much. Lars Am Mittwoch, 20. Oktober 2004 14:48 schrieb Martin J. Evans: > I got it working like this: > > http://www.easysoft.com/products/2002/mxodbc.phtml > > Any feedback on this document welcome. > > but see a comment below. > > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From charlie at egenix.com Thu Oct 21 13:15:23 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <20041021121523.71185.4@Zeta.1098344843.fake> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 charlie at egenix.com Thu Oct 21 04:15:26 2004 From: charlie at egenix.com (Charlie Clark) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <417779C9.7000506@xfr.co.uk> References: <417779C9.7000506@xfr.co.uk> Message-ID: <000201c4b756$e25c3260$6b00a8c0@fonacier.local> Hi Phil, I've cc'd this to the egenix-users list as not many people seem to know it exists. If you suspect that mxODBC is somehow responsible then you should try the call externally and then as an ExternalMethod. The mxODBCZopeDA essentially passes most of the work to the mxODBC driver with the intelligence going into managing threads and transactions. Should the problem be traceable to mxODBC we could provide a debugging version of the driver but I suspect this is _not_ the case. It is more likely to be in the transactional machinery so you need to enable Zope's debugging. Charlie On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > Hi List, > > I have a problem which may or may not be mODBC DA related. The target > database is MS SQL Server 2000. > > A script which calls a ZSQL method which inserts records into a table > from data in a view was reported to be running without error but having > no effect. > > On testing the ZSQL method in isolation, the results set returned the > appropriate number of records, complete with identity field data. On > reviewing the table, the records were not there but the counter for the > identity field indicated that the numbers in question had been allocated. > > As far as I can determine, this must be a failed transaction which is > being rolled back (But should I see a result dataset in the ZSQL method > if this were the case?). However, I see no error indicating the reason > for the failure, and when the identical code to that in the ZSQL method > was run as a stored procedure, the process ran as intended (e.g. the > transaction was not rolled back). > > How can I figure out if I am right about the roll back, and identify the > reason for the difference in behaviour of the same script in the two > different locations? > > I do not now have a failing data set - subsequent batches of data were > processed as intended, using the ZSQL Method. -- 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 ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From mal at egenix.com Thu Oct 21 13:48:27 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk> <20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <417793FB.5010506@egenix.com> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Thu Oct 21 05:01:05 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Re: [Zope-DB] Wierd rollback problem in mxODBC DA In-Reply-To: <20041021121523.71185.4@Zeta.1098344843.fake> References: <417779C9.7000506@xfr.co.uk><20041021121523.71185.4@Zeta.1098344843.fake> Message-ID: <000101c4b75d$42bbc520$6b00a8c0@fonacier.local> Charlie Clark wrote: > Hi Phil, > > I've cc'd this to the egenix-users list as not many people seem to know it > exists. [Note that egenix-users is member posting only due to the amount of spam we would receive otherwise] > If you suspect that mxODBC is somehow responsible then you should try the > call externally and then as an ExternalMethod. The mxODBCZopeDA essentially > passes most of the work to the mxODBC driver with the intelligence going > into managing threads and transactions. Should the problem be traceable to > mxODBC we could provide a debugging version of the driver but I suspect > this is _not_ the case. It is more likely to be in the transactional > machinery so you need to enable Zope's debugging. > > Charlie > > On 2004-10-21 at 10:56:41 [+0200], Philip Kilner wrote: > >>Hi List, >> >>I have a problem which may or may not be mODBC DA related. The target >>database is MS SQL Server 2000. >> >>A script which calls a ZSQL method which inserts records into a table >>from data in a view was reported to be running without error but having >>no effect. >> >>On testing the ZSQL method in isolation, the results set returned the >>appropriate number of records, complete with identity field data. On >>reviewing the table, the records were not there but the counter for the >>identity field indicated that the numbers in question had been allocated. >> >>As far as I can determine, this must be a failed transaction which is >>being rolled back (But should I see a result dataset in the ZSQL method >>if this were the case?). However, I see no error indicating the reason >>for the failure, and when the identical code to that in the ZSQL method >>was run as a stored procedure, the process ran as intended (e.g. the >>transaction was not rolled back). >> >>How can I figure out if I am right about the roll back, and identify the >>reason for the difference in behaviour of the same script in the two >>different locations? The mxODBC Zope DA's transaction mechanism is controlled by Zope, so if Zope thinks that it needs to undo or redo the current transaction, it signals this to the DA which then issues a rollback as necessary. If you want to have the DA generate debug output, you have to set the internal variable _debug to 1 or 2. This can only be done at the Python level by importing the product and adjusting the variable directly: from Products.mxODBCZopeDA import ZopeDA ZopeDA._debug = 2 The DA will then print out lots and lots of information, including whether it issues a rollback or commit. >>I do not now have a failing data set - subsequent batches of data were >>processed as intended, using the ZSQL Method. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: _______________________________________________ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db From jmountjoy at nngov.com Thu Oct 21 12:30:14 2004 From: jmountjoy at nngov.com (Jaime Mountjoy) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem Message-ID: <4177D606.6090504@nngov.com> We have recently installed the mxODBC Zope Database Adapter on a Suse 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the 1.0.9 release of the database adapter because we were getting the PyUnicodeUCS error. It appears that the database adapter is installed correctly, and database connections can be created, but they cannot be opened. When I attempt to open a database connection to a DB2 data source in Zope, I get the following error: ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name missing or invalid.', 7952) I can connect to the same data source using the same credentials with ISQL without a problem, and I can run queries from a python program on that server using mx.ODBC.unixODBC. I was thinking that it was a data source problem with unixODBC or the StarSQL driver, but since I can use ISQL and mxODBC with python, I'm not quite sure what the problem is. Any help would be much appreciated. Thanks Jaime From mal at egenix.com Thu Oct 21 18:50:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] mxODBC Zope DA, Suse, UnixODBC Data Source problem In-Reply-To: <4177D606.6090504@nngov.com> References: <4177D606.6090504@nngov.com> Message-ID: <4177DAB5.4010301@egenix.com> Jaime Mountjoy wrote: > We have recently installed the mxODBC Zope Database Adapter on a Suse > 9.1 server (with Python 2.3.3 and Zope). We ended up having to use the > 1.0.9 release of the database adapter because we were getting the > PyUnicodeUCS error. It appears that the database adapter is installed > correctly, and database connections can be created, but they cannot be > opened. When I attempt to open a database connection to a DB2 data > source in Zope, I get the following error: > > ('08004', 0, '[unixODBC][StarSQL][StarSQL CLI Driver] Data source name > missing or invalid.', 7952) > > I can connect to the same data source using the same credentials with > ISQL without a problem, and I can run queries from a python program on > that server using mx.ODBC.unixODBC. I was thinking that it was a data > source problem with unixODBC or the StarSQL driver, but since I can use > ISQL and mxODBC with python, I'm not quite sure what the problem is. > > Any help would be much appreciated. Thanks It seems that the Zope process is not seeing the same environment settings that you are using in an interactive shell. The fact that the error message is prefxed with [unixODBC][StarSQL] [StarSQL CLI Driver] indicates that the StarSQL driver is having problems finding its configuration files. I suggest you run Zope under truss to find out where the driver is looking and what it is looking for. HTH, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 21 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:28:20 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c Message-ID: Could anyone explain the origin of the following comment in mxODBC.c (specifically the reference to the Easysoft Oracle driver)? How do you reproduce this? Thanks. if (null_terminated) { /* Remove null termination; various ODBC drivers have bugs in the way the handle null-termination: * EasySoft ODBC for Oracle does not null-terminate character columns, even though it should * MS SQL Server ODBC always null-terminates Unicode columns with two nulls, even when fetching the data as SQL_C_CHAR where it should only append one null-termination character The ODBC standard is unclear about what to do, but using sizeof(SQLWCHAR) seems to work in most cases. We have to careful here, since some database drivers allow passing binary data back through character columns, so embedded nulls are well possible. Thanks to Tommi Auvinen for helping to track down the MS SQL Server problem. */ char *data = (char *)newdata; int endofdata = offset + received - 1; if (data[endofdata] == '\0') { received--; #ifdef SQL_WCHAR if (data[endofdata - 1] == '\0') { if (var->ctype == SQL_C_WCHAR || var->sqltype == SQL_WCHAR || var->sqltype == SQL_WVARCHAR || var->sqltype == SQL_WLONGVARCHAR) received -= sizeof(SQLWCHAR) - 1; } #endif } } -- Martin J. Evans Easysoft Ltd, UK Development From mal at egenix.com Fri Oct 22 16:49:29 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: References: Message-ID: <41790FE9.1080100@egenix.com> Martin J. Evans wrote: > Could anyone explain the origin of the following comment in mxODBC.c > (specifically the reference to the Easysoft Oracle driver)? We had to add that work-around to make mxODBC work with the EasySoft Oracle driver 1.0.0.6. Things may be different with more recent versions. The work-around adapts accordingly. > How do you reproduce this? Simple: query a BLOB of say 1MB data from the database. > Thanks. > > if (null_terminated) { > /* Remove null termination; various ODBC drivers have bugs > in the way the handle null-termination: > > * EasySoft ODBC for Oracle does not null-terminate character > columns, even though it should > > * MS SQL Server ODBC always null-terminates Unicode columns > with two nulls, even when fetching the data as SQL_C_CHAR > where it should only append one null-termination character > > The ODBC standard is unclear about what to do, but > using sizeof(SQLWCHAR) seems to work in most > cases. We have to careful here, since some database > drivers allow passing binary data back through > character columns, so embedded nulls are well > possible. > > Thanks to Tommi Auvinen for helping to track down > the MS SQL Server problem. > > */ > char *data = (char *)newdata; > int endofdata = offset + received - 1; > if (data[endofdata] == '\0') { > received--; > #ifdef SQL_WCHAR > if (data[endofdata - 1] == '\0') { > if (var->ctype == SQL_C_WCHAR || > var->sqltype == SQL_WCHAR || > var->sqltype == SQL_WVARCHAR || > var->sqltype == SQL_WLONGVARCHAR) > received -= sizeof(SQLWCHAR) - 1; > } > #endif > } > } > > > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 15:55:07 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> Message-ID: Thanks for the explanation - I'll look in to this to make sure it is no longer the case. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 22-Oct-2004 M.-A. Lemburg wrote: > Martin J. Evans wrote: >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > Simple: query a BLOB of say 1MB data from the database. > >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.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 Fri Oct 22 17:04:06 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41790FE9.1080100@egenix.com> References: <41790FE9.1080100@egenix.com> Message-ID: <41791356.1080307@egenix.com> M.-A. Lemburg wrote: > Martin J. Evans wrote: > >> Could anyone explain the origin of the following comment in mxODBC.c >> (specifically the reference to the Easysoft Oracle driver)? > > > We had to add that work-around to make mxODBC work with the > EasySoft Oracle driver 1.0.0.6. Things may be different with > more recent versions. The work-around adapts accordingly. > >> How do you reproduce this? > > > Simple: query a BLOB of say 1MB data from the database. Sorry: make that CLOB (the problem only triggers for character data such as XML data). >> Thanks. >> >> if (null_terminated) { >> /* Remove null termination; various ODBC drivers have >> bugs >> in the way the handle null-termination: >> >> * EasySoft ODBC for Oracle does not null-terminate >> character >> columns, even though it should >> >> * MS SQL Server ODBC always null-terminates Unicode >> columns >> with two nulls, even when fetching the data as >> SQL_C_CHAR >> where it should only append one null-termination >> character >> >> The ODBC standard is unclear about what to do, but >> using sizeof(SQLWCHAR) seems to work in most >> cases. We have to careful here, since some database >> drivers allow passing binary data back through >> character columns, so embedded nulls are well >> possible. >> >> Thanks to Tommi Auvinen for helping to track down >> the MS SQL Server problem. >> >> */ >> char *data = (char *)newdata; >> int endofdata = offset + received - 1; >> if (data[endofdata] == '\0') { >> received--; >> #ifdef SQL_WCHAR >> if (data[endofdata - 1] == '\0') { >> if (var->ctype == SQL_C_WCHAR || >> var->sqltype == SQL_WCHAR || >> var->sqltype == SQL_WVARCHAR || >> var->sqltype == SQL_WLONGVARCHAR) >> received -= sizeof(SQLWCHAR) - 1; >> } >> #endif >> } >> } >> >> >> -- >> Martin J. Evans >> Easysoft Ltd, UK >> Development >> >> >> _______________________________________________________________________ >> eGenix.com User Mailing List http://www.egenix.com/ >> http://lists.egenix.com/mailman/listinfo/egenix-users > > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 22 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Fri Oct 22 16:48:47 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix] Re: [egenix-users] Null termination differences in drivers - comment in mxODBC.c In-Reply-To: <41791356.1080307@egenix.com> Message-ID: On 22-Oct-2004 M.-A. Lemburg wrote: > M.-A. Lemburg wrote: >> Martin J. Evans wrote: >> >>> Could anyone explain the origin of the following comment in mxODBC.c >>> (specifically the reference to the Easysoft Oracle driver)? >> >> >> We had to add that work-around to make mxODBC work with the >> EasySoft Oracle driver 1.0.0.6. Things may be different with >> more recent versions. The work-around adapts accordingly. >> >>> How do you reproduce this? >> >> >> Simple: query a BLOB of say 1MB data from the database. > > Sorry: make that CLOB (the problem only triggers for character > data such as XML data). I believe with Easysoft ODBC-Oracle V1.3 and later this works fine without your workaround and I think it should work in versions from 1.1 onwards but have not tested all of those. Thanks again for the pointer. >>> Thanks. >>> >>> if (null_terminated) { >>> /* Remove null termination; various ODBC drivers have >>> bugs >>> in the way the handle null-termination: >>> >>> * EasySoft ODBC for Oracle does not null-terminate >>> character >>> columns, even though it should >>> >>> * MS SQL Server ODBC always null-terminates Unicode >>> columns >>> with two nulls, even when fetching the data as >>> SQL_C_CHAR >>> where it should only append one null-termination >>> character >>> >>> The ODBC standard is unclear about what to do, but >>> using sizeof(SQLWCHAR) seems to work in most >>> cases. We have to careful here, since some database >>> drivers allow passing binary data back through >>> character columns, so embedded nulls are well >>> possible. >>> >>> Thanks to Tommi Auvinen for helping to track down >>> the MS SQL Server problem. >>> >>> */ >>> char *data = (char *)newdata; >>> int endofdata = offset + received - 1; >>> if (data[endofdata] == '\0') { >>> received--; >>> #ifdef SQL_WCHAR >>> if (data[endofdata - 1] == '\0') { >>> if (var->ctype == SQL_C_WCHAR || >>> var->sqltype == SQL_WCHAR || >>> var->sqltype == SQL_WVARCHAR || >>> var->sqltype == SQL_WLONGVARCHAR) >>> received -= sizeof(SQLWCHAR) - 1; >>> } >>> #endif >>> } >>> } >>> >>> >>> -- >>> Martin J. Evans >>> Easysoft Ltd, UK >>> Development >>> >>> >>> _______________________________________________________________________ >>> eGenix.com User Mailing List http://www.egenix.com/ >>> http://lists.egenix.com/mailman/listinfo/egenix-users >> >> > > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 22 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: Martin -- Martin J. Evans Easysoft Ltd, UK Development From scott at zopeworks.us Fri Oct 22 14:51:16 2004 From: scott at zopeworks.us (Scott Burchill) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] problems with mxCommercial on Solaris Message-ID: <417956A4.4000707@zopeworks.us> > Brilliant! > > Your document was exactly what I needed. I followed the steps and managed to > get the mxODBC.unixODBC driver working. Well... after I went through my usual > hassle with wrong or missing library-paths under Solaris. > > Thank you very much. > > Lars Lars, Specifically, what was your solution to the "usual" wrong or missing libraries? I'm trying to compile this package under Solaris and the make seems to cough looking for "sql.h". Any help would be greatly appreciated! Scott -- sbb \:)> /:(> From ielbert at genuone.com Mon Oct 25 14:28:11 2004 From: ielbert at genuone.com (Igor Elbert) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: <20041020082338.CEBC61A6D0@mail.egenix.com> Message-ID: When testing mxODBCZopeDA we frequently encounter ReadConflict errors related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: Traceback (most recent call last): File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ DB__=dbc() File "..../lib/python\ZODB\Connection.py", line 553, in setstate invalid = self._is_invalidated(obj) File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated raise ReadConflictError(object=obj) ReadConflictError: database read conflict error (oid 0000000000001bac, class Products.mxODBCZopeDA.ZopeDA.ZopeConnection ) This causes Zope's DA to raise 'Not connected to a database' exception. When user hits "reload" the problem disappears. It can not be a timeout issues since the problem hits actively working users. Our environment is: Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python 2.1.3, win32) Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] System Platform win32 Connection Information Connected database: Microsoft SQL Server, 08.00.0194 ODBC driver: SQLSRV32.DLL, 03.80.0194 Please help! Thank you, Igor Elbert This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. From keithmoore1 at adelphia.net Mon Oct 25 16:01:20 2004 From: keithmoore1 at adelphia.net (Keith Moore) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Embedding mx Message-ID: I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to import mx.ODBC.Windows, I get an access violation. Has anyone seen this? What am I doing wrong? #include /* standard API def */ void main() { //version 1 printf("embed_simple\n"); Py_Initialize(); PyRun_SimpleString("import mx"); >> PyRun_SimpleString("import mx.ODBC.Windows"); << I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access violation. From mal at egenix.com Tue Oct 26 10:29:13 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Embedding mx In-Reply-To: References: Message-ID: <417DFCC9.9010907@egenix.com> Keith Moore wrote: > I'm using Visual C++ 6.0 to step thru the snippet below. When I attempt to > import mx.ODBC.Windows, I get an access violation. Has anyone seen this? > What am I doing wrong? > > > #include /* standard API def */ > > void main() > { > //version 1 > printf("embed_simple\n"); > Py_Initialize(); > PyRun_SimpleString("import mx"); > >> PyRun_SimpleString("import mx.ODBC.Windows"); << > > I get Unhandled exception in Embed_Simple.exe...(PYTHON23_D.DLL)...Access > violation. It would help if you could provide stack trace information. I remember that there was a problem with mxDateTime compiled with a Python debug version. Those problems are fixed in more recent egenix-mx-base 2.1 betas. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Tue Oct 26 10:31:57 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Critical: ReadConflict Error with mxODBCZopeDA In-Reply-To: References: Message-ID: <417DFD6D.1060306@egenix.com> Igor Elbert wrote: > When testing mxODBCZopeDA we frequently encounter ReadConflict errors > related to mxODBCZopeDA.ZopeDA.ZopeConnection object. Traceback is: > > Traceback (most recent call last): > File "..../lib/python\Shared\DC\ZRDB\DA.py", line 398, in __call__ > DB__=dbc() > File "..../lib/python\ZODB\Connection.py", line 553, in setstate > invalid = self._is_invalidated(obj) > File "..../lib/python\ZODB\Connection.py", line 579, in _is_invalidated > raise ReadConflictError(object=obj) > ReadConflictError: database read conflict error (oid 0000000000001bac, class > Products.mxODBCZopeDA.ZopeDA.ZopeConnection > ) > > This causes Zope's DA to raise 'Not connected to a database' exception. Please make sure that you have connection pooling disabled in the ODBC manager and enabled in the mxODBC Zope DA. It may be necessary to set the pool size of the Zope DA to a higher value. > When user hits "reload" the problem disappears. It can not be a timeout > issues since the problem hits actively working users. > > Our environment is: > Zope Version (Zope 2.6.2 (binary release, python 2.1, win32-x86), python > 2.1.3, win32) > Python Version 2.1.3 (#35, Apr 8 2002, 17:47:50) [MSC 32 bit (Intel)] > System Platform win32 > Connection Information Connected database: Microsoft SQL Server, 08.00.0194 > ODBC driver: SQLSRV32.DLL, 03.80.0194 > > Please help! > > Thank you, > Igor Elbert > > This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From lrehe at awi-bremerhaven.de Tue Oct 26 10:54:26 2004 From: lrehe at awi-bremerhaven.de (Lars Rehe) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] problems with mxCommercial on Solaris In-Reply-To: <417956A4.4000707@zopeworks.us> References: <417956A4.4000707@zopeworks.us> Message-ID: <200410260954.26675.lrehe@awi-bremerhaven.de> Scott, well... I often have the problem, that certain required libraries are not found during configuration because I installed them in non-standard directories. (e.g. /usr/local/mysql/lib ) After over a year of occasional software installations on solaris, I still have no clue how compiler-flags, linker-flags and the like work together. Usually I end up using 'crle' to edit the runtime linking env globally. Ok, I confessed - start bashing. (Or give me a hint where to find appropiate literature on the topic) In your case, I would try to use something like export CFLAGS="-I/path/to/your/db/inst/dir/include" . But as I just mentioned - maybe it would be safer to ask somebody who really knows about software installation on solaris. :-) Regards, Lars Am Freitag, 22. Oktober 2004 20:51 schrieb Scott Burchill: > Lars, > > Specifically, what was your solution to the "usual" wrong or > missing libraries? I'm trying to compile this package under Solaris and > the make seems to cough looking for "sql.h". Any help would be greatly > appreciated! > > Scott > -- To boldly go where I surely don't belong. Lars Rehe Alfred Wegener Institut f?r Polar- und Meeresforschung From mal at egenix.com Tue Oct 26 19:33:15 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Posting to this list Message-ID: <417E7C4B.9020704@egenix.com> Hello everybody, I'm writing to you because we get quite a bit of email to this list from people who are not subscribed and I think we have to do something about it. We've changed the setting for the mailing list to reject those postings now, so that people at least get back a message that subscription is needed and that their posting will not make it to the list. An alternative model would be to open up the list for postings by non-members using a spam filter to at least filter out most of the spam that is sent to the list. Which model would you prefer for the future ? Regards, -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 26 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From martin.evans at easysoft.com Tue Oct 26 18:48:08 2004 From: martin.evans at easysoft.com (Martin J. Evans) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: <417E7C4B.9020704@egenix.com> Message-ID: I prefer membership postings only - it is no great trouble to join and the level of spam in some mailing lists that are open is high. Martin -- Martin J. Evans Easysoft Ltd, UK Development On 26-Oct-2004 M.-A. Lemburg wrote: > Hello everybody, > > I'm writing to you because we get quite a bit of email to this list > from people who are not subscribed and I think we have to do > something about it. > > We've changed the setting for the mailing list to reject those > postings now, so that people at least get back a message that > subscription is needed and that their posting will not make it to > the list. > > An alternative model would be to open up the list for postings > by non-members using a spam filter to at least filter out most > of the spam that is sent to the list. > > Which model would you prefer for the future ? > > Regards, > -- > Marc-Andre Lemburg > eGenix.com > > Professional Python Services directly from the Source (#1, Oct 26 2004) > >>> Python/Zope Consulting and Support ... http://www.egenix.com/ > >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ > >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ > ________________________________________________________________________ > >::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users From mal at egenix.com Wed Oct 27 13:31:00 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix] [egenix-users] Posting to this list In-Reply-To: References: Message-ID: <417F78E4.7040107@egenix.com> Martin J. Evans wrote: > I prefer membership postings only - it is no great trouble to join and the > level of spam in some mailing lists that are open is high. Ok. If no-one else objects, we'll leave it at the current settings then. > Martin > -- > Martin J. Evans > Easysoft Ltd, UK > Development > > > On 26-Oct-2004 M.-A. Lemburg wrote: > >>Hello everybody, >> >>I'm writing to you because we get quite a bit of email to this list >>from people who are not subscribed and I think we have to do >>something about it. >> >>We've changed the setting for the mailing list to reject those >>postings now, so that people at least get back a message that >>subscription is needed and that their posting will not make it to >>the list. >> >>An alternative model would be to open up the list for postings >>by non-members using a spam filter to at least filter out most >>of the spam that is sent to the list. >> >>Which model would you prefer for the future ? >> >>Regards, >>-- >>Marc-Andre Lemburg >>eGenix.com >> >>Professional Python Services directly from the Source (#1, Oct 26 2004) >> >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >> >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >> >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ >>________________________________________________________________________ >> >>::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: >> >> >>_______________________________________________________________________ >>eGenix.com User Mailing List http://www.egenix.com/ >>http://lists.egenix.com/mailman/listinfo/egenix-users > > > > _______________________________________________________________________ > eGenix.com User Mailing List http://www.egenix.com/ > http://lists.egenix.com/mailman/listinfo/egenix-users -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 15:17:00 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Enabling unicode? Message-ID: <433ebc8704102712177b29d737@mail.gmail.com> I have been having unicode problems from time to time with mx.ODBC, libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on some recent flavor of free Red Hat. Being a little slow on the uptake, I only just noticed that there is a constant HAVE_UNICODE_SUPPORT. I just checked it: $ python Python 2.3.3 (#1, Apr 12 2004, 14:00:40) [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mx.ODBC.iODBC >>> mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT 0 >>> When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: *shared* mxODBC mxSQLCodes.c mxODBC.c \ -DMAL_DEBUG \ -DWANT_UNICODE_SUPPORT \ -DMISSING_SETUP which is I think the default. So, although I wanted Unicode, I didn't get it. Did I fail to build iODBC or FreeTDS in such a way as to enable mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? Thanks, Chuck From mal at egenix.com Wed Oct 27 22:51:04 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <433ebc8704102712177b29d737@mail.gmail.com> References: <433ebc8704102712177b29d737@mail.gmail.com> Message-ID: <417FFC28.2010009@egenix.com> Chuck Bearden wrote: > I have been having unicode problems from time to time with mx.ODBC, > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > some recent flavor of free Red Hat. > > Being a little slow on the uptake, I only just noticed that there is a > constant HAVE_UNICODE_SUPPORT. I just checked it: > > $ python > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>>>import mx.ODBC.iODBC >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > 0 > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > *shared* > > > mxODBC mxSQLCodes.c mxODBC.c \ > -DMAL_DEBUG \ > -DWANT_UNICODE_SUPPORT \ > -DMISSING_SETUP > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > Did I fail to build iODBC or FreeTDS in such a way as to enable > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? If you compile the package with the setup.py apporach, edits to Setup or Setup.in don't have any effect. Default for iODBC is not to build with Unicode support, whereas it is always enabled for unixODBC. Nowadays, it is safe to enable Unicode for both. In order to enable it for iODBC as well, you have to edit mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define there. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 27 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From cfbearden at gmail.com Wed Oct 27 17:37:59 2004 From: cfbearden at gmail.com (Chuck Bearden) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Enabling unicode? In-Reply-To: <417FFC28.2010009@egenix.com> References: <433ebc8704102712177b29d737@mail.gmail.com> <417FFC28.2010009@egenix.com> Message-ID: <433ebc870410271437307ef2f4@mail.gmail.com> On Wed, 27 Oct 2004 21:51:04 +0200, M.-A. Lemburg wrote: > Chuck Bearden wrote: > > > I have been having unicode problems from time to time with mx.ODBC, > > libiodbc (3.51.2), and FreeTDS (0.63.dev.20041026 at the moment) on > > some recent flavor of free Red Hat. > > > > Being a little slow on the uptake, I only just noticed that there is a > > constant HAVE_UNICODE_SUPPORT. I just checked it: > > > > $ python > > Python 2.3.3 (#1, Apr 12 2004, 14:00:40) > > [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 > > Type "help", "copyright", "credits" or "license" for more information. > > > >>>>import mx.ODBC.iODBC > >>>>mx.ODBC.iODBC.HAVE_UNICODE_SUPPORT > > > > 0 > > > > > > When I grep out all lines "^#" from mx/ODBC/iODBC/Setup.in, I get this: > > > > *shared* > > > > > > mxODBC mxSQLCodes.c mxODBC.c \ > > -DMAL_DEBUG \ > > -DWANT_UNICODE_SUPPORT \ > > -DMISSING_SETUP > > > > > > which is I think the default. So, although I wanted Unicode, I didn't get it. > > > > Did I fail to build iODBC or FreeTDS in such a way as to enable > > mx.ODBC to define HAVE_UNICODE? Or did I do something else wrong? > > If you compile the package with the setup.py apporach, > edits to Setup or Setup.in don't have any effect. > > Default for iODBC is not to build with Unicode support, > whereas it is always enabled for unixODBC. > > Nowadays, it is safe to enable Unicode for both. > > In order to enable it for iODBC as well, you have to edit > mxCOMMERCIAL.py and add the WANT_UNICODE_SUPPORT define > there. Thank you for your reply. Sorry to be so dense, but I don't seem to be able to figure this out. I modified the Extension() definition for iODBC in mxCOMMERCIAL.py like so: Extension('mx.ODBC.iODBC.mxODBC', ['mx/ODBC/iODBC/mxODBC.c', 'mx/ODBC/iODBC/mxSQLCodes.c' ], include_dirs=['mx/ODBC/iODBC', '/usr/local/libiodbc/include'], define_macros=[('iODBC', None), ('WANT_UNICODE_SUPPORT', 1)], library_dirs=['/usr/local/libiodbc/lib'], libraries=['iodbc'] ), that is, I modified the paths to my iODBC libs and includes, and I added 'WANT_UNICODE_SUPPORT' to the define_macros list (I tried with values of None and 1). I build with python setup.py install --home=/home/cbearden/opt I get this: [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path= ['/home/cbearden/opt/lib/python'] + sys.path >>> import mx.ODBC.iODBC as mxodbc >>> mxodbc.HAVE_UNICODE_SUPPORT 0 >>> Just to be absolutely certain I was using the module I had just built, I modified __version__ in mx/ODBC/ODBC.py (added '-foo'' to the string) and checked it from within the same interactive shell. Surely I am doing some simple thing wrong such that I am not getting Unicode support. Chuck From peter.millar at parasyn.com.au Thu Oct 28 09:03:23 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <004801c4bc70$c73254a0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 16:20:19 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Time out problem if you database server goes offline Message-ID: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> I am using windows mxODBCZopeDA 1.0.8. It has been working perfectly. I am running zope with a manually added mxodbc connection. I have a product that uses this connection. Today our database server died. The status page of the database adaptor showed that the connection was closed, even though I didn't close it. I decided to put some error checking in around my code using the connection, so that I don't query the db if the connection is dead. My code looks like this: #self.dbConnectionId = mxODBCZopeDA connection id dbConnection = getattr(self, self.dbConnectionId) print 'am I there yet' if dbConnection.connected() == 0: results = 'DB CONNECTION IS CLOSED' print results return results else: return dbConnection() === END OF CODE === The first print statement prints instantly. The problem I have is that it takes forever to print 'DB CONNECTION IS CLOSED' I am talking like 5 minutes. WHY?? I don't have the connect on demand setting set. Is there some internal setting where if the connection is stuffed it will retry until it gets bored?? Alternatively ... Once we got the machine working, I stopped the connection myself and my code returns instantly. So there appears to be a problem here!!! ____________________________________________ Peter Millar From peter.millar at parasyn.com.au Thu Oct 28 11:29:26 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA Message-ID: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> We had a database go down and so the database components of our site died . unfortunately the error messages contain the database username and password. How can we change the error message, Prevent the user from seeing the information?? The message said: Type - Bad Request Message - EGENIX.COM mxODBC Zope DA Database connection is closed Connection id: server7 Connection title: server7 Connection string: DSN=server7 UID PWD If this is not possible can I submit this as a change request for the next release of mxODBCZopeDA please. An option to remove UID and PWD from user messages. ____________________________________________ Peter Millar Technical Project Manager Parasyn Controls Pty Ltd Peter.Millar@Parasyn.com.au T: 61 7 3396 6388 F: 61 7 3396 6299 45 Millenium Place, Tingalpa QLD 4173 PO Box 400 Cannon Hill QLD 4170 Australia www.parasyn.com.au -------------- next part -------------- An HTML attachment was scrubbed... URL: /mailman-archives/egenix-users/attachments/20041028/ebea39ad/attachment-0139.htm From mal at egenix.com Thu Oct 28 10:54:14 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> References: <006701c4bc85$2e39aae0$0904000a@corp.parasyn.com.au> Message-ID: <4180A5A6.5000509@egenix.com> Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From peter.millar at parasyn.com.au Fri Oct 29 08:32:07 2004 From: peter.millar at parasyn.com.au (Peter Millar) Date: Fri Mar 31 16:33:50 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <4180A5A6.5000509@egenix.com> Message-ID: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Thanks, Is there an update of the Zope DA that has this in it?? Or will it be the next version and if so do you have a time frame for release of that version?? ____________________________________________ Peter Millar -----Original Message----- From: M.-A. Lemburg [mailto:mal@egenix.com] Sent: Thursday, 28 October 2004 17:54 To: Peter Millar Cc: egenix-users@egenix.com Subject: Re: [egenix-users] Password appearing in messages from mxODBC Zope DA Peter Millar wrote: > We had a database go down and so the database components of our site > died . unfortunately the error messages contain the database username > and password. > > How can we change the error message, > Prevent the user from seeing the information?? > > The message said: > Type - Bad Request > Message - EGENIX.COM mxODBC Zope DA > Database connection is closed > Connection id: server7 > Connection title: server7 > Connection string: DSN=server7 > UID > PWD > > If this is not possible can I submit this as a change request for the > next release of mxODBCZopeDA please. An option to remove UID and PWD > from user messages. Good catch. We'll correct that message to only show the DSN part (just like we do in other parts of the DA). -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 01:15:22 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:51 2006 Subject: [egenix-users] Password appearing in messages from mxODBC Zope DA In-Reply-To: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> References: <00c801c4bd35$9388d0f0$0904000a@corp.parasyn.com.au> Message-ID: <41816F7A.7040901@egenix.com> Peter Millar wrote: > Thanks, > > Is there an update of the Zope DA that has this in it?? Or will it be > the next version and if so do you have a time frame for release of that > version?? We'll add it to the next release which should happen before the end of the year. > ____________________________________________ > Peter Millar > > > -----Original Message----- > From: M.-A. Lemburg [mailto:mal@egenix.com] > Sent: Thursday, 28 October 2004 17:54 > To: Peter Millar > Cc: egenix-users@egenix.com > Subject: Re: [egenix-users] Password appearing in messages from mxODBC > Zope DA > > > Peter Millar wrote: > >>We had a database go down and so the database components of our site >>died . unfortunately the error messages contain the database username >>and password. >> >>How can we change the error message, >>Prevent the user from seeing the information?? >> >>The message said: >>Type - Bad Request >>Message - EGENIX.COM mxODBC Zope DA >>Database connection is closed >>Connection id: server7 >>Connection title: server7 >>Connection string: DSN=server7 >>UID >>PWD >> >>If this is not possible can I submit this as a change request for the >>next release of mxODBCZopeDA please. An option to remove UID and PWD >>from user messages. > > > Good catch. We'll correct that message to only show the DSN part (just > like we do in other parts of the DA). > -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 28 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.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 Fri Oct 29 10:53:24 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:51 2006 Subject: [egenix-users] Time out problem if you database server goes offline In-Reply-To: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> References: <00bd01c4bcad$d11a91c0$0904000a@corp.parasyn.com.au> Message-ID: <4181F6F4.9020802@egenix.com> Peter Millar wrote: > I am using windows mxODBCZopeDA 1.0.8. > > It has been working perfectly. > > I am running zope with a manually added mxodbc connection. > > I have a product that uses this connection. > > Today our database server died. > > The status page of the database adaptor showed that the connection was > closed, even though I didn't close it. > > I decided to put some error checking in around my code using the > connection, so that I don't query the db if the connection is dead. > > My code looks like this: > #self.dbConnectionId = mxODBCZopeDA connection id > > dbConnection = getattr(self, self.dbConnectionId) > > print 'am I there yet' > > if dbConnection.connected() == 0: > results = 'DB CONNECTION IS CLOSED' > print results > return results > else: > return dbConnection() > > === END OF CODE === > > The first print statement prints instantly. > The problem I have is that it takes forever to print 'DB CONNECTION IS > CLOSED' I am talking like 5 minutes. WHY?? > > I don't have the connect on demand setting set. > > Is there some internal setting where if the connection is stuffed it > will retry until it gets bored?? The mxODBC Zope DA tries to reconnect if you have set the connection to open and it finds that the connection has gone down. The reconnect delay depends on the ODBC driver, the network connection and the database backend. In any case, it's beyond the control of the DA. > Alternatively ... Once we got the machine working, I stopped the > connection myself and my code returns instantly. > > So there appears to be a problem here!!! Yes, but it is likely not related to the DA itself. Which ODBC driver are you using ? -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! :::: From F.Baart at SFK.NL Fri Oct 29 12:21:14 2004 From: F.Baart at SFK.NL (F.Baart@SFK.NL) Date: Fri Mar 31 16:33:51 2006 Subject: [egenix-users] mxODBC and decimals Message-ID: Hi, Python 2.4 has a new decimal type. Are there any plans for making that the default return type for decimal columns in mxODBC? This would break a lot of my code, but it does seem like a logical choice. Thanks, Fedor Baart From mal at egenix.com Fri Oct 29 12:26:20 2004 From: mal at egenix.com (M.-A. Lemburg) Date: Fri Mar 31 16:33:51 2006 Subject: [egenix-users] mxODBC and decimals In-Reply-To: References: Message-ID: <41820CBC.30102@egenix.com> F.Baart@SFK.NL wrote: > Hi, > > Python 2.4 has a new decimal type. Are there any plans for making that the > default return type for decimal columns in mxODBC? > This would break a lot of my code, but it does seem like a logical choice. Unfortunately, the new decimal type does not have a proper C interface, so mxODBC will have to use the Python interface for it, making access and creation rather slow. In any case, the default type mapping in mxODBC is not going to change. We are, however, going to offer more more options for input and output types in future releases. The new Decimal type will certainly be one option to choose from for decimal columns. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Oct 29 2004) >>> Python/Zope Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/ ________________________________________________________________________ ::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::